Fix uninitialized read in doveadm-oldstats
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 23 Jul 2022 14:38:23 +0000 (16:38 +0200)
committerNoah Meyerhans <noahm@debian.org>
Sat, 30 Jul 2022 02:58:28 +0000 (19:58 -0700)
commit4b528e943f635b110229ca74fd11c2d6df992ded
tree0c2b0b8408bd6b81ce8fde8d9425ab3ab16b7040
parentcb24d1a5e7895b2bb1d05af4b1a63edefe547126
Fix uninitialized read in doveadm-oldstats

The third argument to doveadm_cmd_param_bool() is only set on a return
value of TRUE.
Since disk_input_field and disk_output_field should be set if the value
of show-disk-io is specified and specified to true, fix the condition.

    doveadm-oldstats.c: In function 'cmd_stats_top':
    doveadm-oldstats.c:551:63: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
      551 |         if (!doveadm_cmd_param_bool(cctx, "show-disk-io", &b) && b) {
          |                                                               ^
    doveadm-oldstats.c:545:14: note: 'b' was declared here
      545 |         bool b;
          |              ^

Gbp-Pq: Name Fix-uninitialized-read-in-doveadm-oldstats.patch
src/doveadm/doveadm-oldstats.c